/* GUI CONVERTED from rcmbrp01.p (converter v1.75) Tue Apr 10 12:04:46 2001 */
/* rcmbrp01.p - MASTER BILL PRINT                                             */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.8.1.4 $                                                       */
/*V8:ConvertMode=Report                                                       */
/* REVISION: 7.5      LAST MODIFIED: 03/21/95   BY: GWM *J049*                */
/* REVISION: 8.6      LAST MODIFIED: 08/30/96   BY: *K003* Vinay Nayak-Sujir  */
/* REVISION: 8.6      LAST MODIFIED: 04/11/97   BY: *K08N* Steve Goeke        */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 07/25/00   BY: *N0GQ* BalbeerS Rajput    */
/* $Revision: 1.8.1.4 $    BY: Jean Miller          DATE: 03/22/01 ECO: *P008*    */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdeclre.i}
{gplabel.i} /* EXTERNAL LABEL INCLUDE */

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rcmbrp01_p_10 "Shipper"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

/* INPUT PARAMETERS */
define input parameter abs_recid as recid.

/* SHARED VARIABLES FOR EXISTING CODE */
define new shared variable addr as character format "x(38)" extent 6.

/* LOCAL VARIABLES */
define variable shipto       as character format "x(38)" extent 6 no-undo.
define variable company      as character format "x(38)" extent 6 no-undo.
define variable print_date   as   date no-undo.
define variable ship         like so_ship no-undo.
define variable i            as   integer no-undo.
define variable v_start_page as   integer no-undo.

define variable shipper      as character format "x(20)"
                             label {&rcmbrp01_p_10} no-undo.

/* BUFFERS */
define buffer abs_bill for abs_mstr.

/* FROZEN SCHEMA NEW FIELDS */
{rcmbrpa.i}

/* BEGIN PROGRAM */
find first soc_ctrl no-lock.

find abs_mstr where recid(abs_mstr) = abs_recid no-lock.

assign
   v_start_page = page-number
   shipto = ""
   company = "".

/* GET COMPANY ADDRESS */
find ad_mstr where ad_addr = soc_comp no-lock no-error.
if available ad_mstr then do:
   addr[1] = ad_name.
   addr[2] = ad_line1.
   addr[3] = ad_line2.
   addr[4] = ad_line3.
   addr[6] = ad_country.
   {mfcsz.i addr[5] ad_city ad_state ad_zip}.
   {gprun.i ""gpaddr.p"" }
   company[1] = addr[1].
   company[2] = addr[2].
   company[3] = addr[3].
   company[4] = addr[4].
   company[5] = addr[5].
   company[6] = addr[6].
end.

/* GET SHIPTO ADDRESS */
find ad_mstr where ad_addr = abs_shipto no-lock no-error.
if available ad_mstr then do:
   addr[1] = ad_name.
   addr[2] = ad_line1.
   addr[3] = ad_line2.
   addr[4] = ad_line3.
   addr[6] = ad_country.
   {mfcsz.i addr[5] ad_city ad_state ad_zip}.
   {gprun.i ""gpaddr.p"" }
   shipto[1] = addr[1].
   shipto[2] = addr[2].
   shipto[3] = addr[3].
   shipto[4] = addr[4].
   shipto[5] = addr[5].
   shipto[6] = addr[6].
   ship = ad_addr.
end.

print_date = today.

assign
   abs_shipvia    = substring(abs__qad01,1,20)
   abs_fob        = substring(abs__qad01,21,20)
   abs_carr_ref   = substring(abs__qad01,41,20)
   abs_trans_mode = substring(abs__qad01,61,20)
   abs_veh_ref    = substring(abs__qad01,81,20).

/* PRINT HEADING */
display
   skip (3)
   company[1]                                   at 4
   getTermLabelRt("BANNER_MASTER_BILL_OF_LADING", 38) to 79
   format "x(38)"
   company[2]                                   at 4
   company[3]                                   at 4
   getTermLabelRtColon("MASTER_ID",16)          to 58 format "x(16)"
   substring(abs_id,2,20) format "x(20)"
   company[4]                                   at 4
   company[5]                                   at 4
   getTermLabelRtColon("PRINT_DATE",16)         to 58 format "x(16)"
   print_date
   getTermLabelRtColon("PAGE_OF_REPORT",16)     to 58 format "x(16)"
   trim(string(page-number - v_start_page + 1)) format "XXXX"
   company[6]                                   at 4
   skip (1)
   getTermLabel("SHIP_TO",15) + ": " +
   ship
   at 8 format "x(26)"
   skip (1)
   shipto[1]                                    at 8
   shipto[2]                                    at 8
   shipto[3]                                    at 8
   shipto[4]                                    at 8
   shipto[5]                                    at 8
   shipto[6]                                    at 8
   skip(5)
   getTermLabelRtColon("SHIP_VIA",12)           to 12 format "x(12)"
   abs_shipvia
   getTermLabelRtColon("MODE_OF_TRANSPORT",24)  to 58 format "x(24)"
   abs_trans_mode
   getTermLabelRtColon("FOB_POINT",12)          to 12 format "x(12)"
   abs_fob
   getTermLabelRtColon("CARRIER_SHIPMENT_REFERENCE",24) to 58 format "x(24)"
   abs_carr_ref
   getTermLabelRtColon("VEHICLE_ID",24)         to 58 format "x(24)"
   abs_veh_ref
   skip(3)
with frame heading page-top width 90 no-box no-attr-space no-labels STREAM-IO /*GUI*/ .

/* PRINT COMMENTS IF ANY */
if abs_cmtindx > 0 then do:
   {gpcmtprt.i &type=SH &id=abs_cmtindx &pos=3}
   display " " skip(1) WITH STREAM-IO /*GUI*/ .
end.

/* PRINT DETAIL */
for each abs_bill where
         abs_bill.abs_master_id = abs_mstr.abs_id
no-lock with frame b:

   /* SET EXTERNAL LABELS */
   setFrameLabels(frame b:handle).

   display
      space(5)
      substring(abs_bill.abs_id,2,20) @ shipper
      abs_bill.abs_gwt
      abs_bill.abs_wt_um
      abs_bill.abs_shipto
   with frame b down STREAM-IO /*GUI*/ .

   
/*GUI*/ {mfguichk.i  &warn=false} /*Replace mfrpchk*/


end. /* FOR EACH ABS_BILL */

display
   getTermLabel("TOTAL_WEIGHT",24) + ": " +  string(abs_mstr.abs_gwt) + " " +
                                             abs_mstr.abs_wt_um
   at 20 format "x(40)"
with frame c no-labels STREAM-IO /*GUI*/ .

/* Print carrier information */
{gprun.i ""rcrpcar.p"" "(input abs_mstr.abs_id, input 6)"}
